<?php
class Blacklist extends AppModel {

    var $name = 'Blacklist';
    var $validate = array(
        'ip_address' => array(
        'rule-1' => array('rule' => 'ip','message'=>'IP address is not valid'),
        'rule-2' => array('rule' => 'isUnique','message' => 'IP address already exists')
        )
    );

    function check($ip_address) {
        return $this->find(array('ip_address'=>$ip_address));
    }
}
?>